function doPost(url,data,callbackfunc) {
    //console.log("doPost:"+callbackfunc)
    if (false) {
        $.post(url, data,
            //headers:{'Access-Control-Allow-Origin':'*'},
            function (data, status) {
                //alert("Data: " + data + "nStatus: " + status);
                //alert($("#result"));
                callbackfunc(data,status);
            });
    } else {
        $.ajax({
            url: url,
            //'Access-Control-Allow-Origin':'*'
            type: "post",
            traditional: true,
            data: data,//JSON.stringify(data),
            success: function (data){
                callbackfunc(data,"success");
            }
        });
    }

}

function doGet(url,callbackfunc,context) {

        $.ajax({
            url: url,
            //'Access-Control-Allow-Origin':'*'
            type: "get",
            traditional: true,
            success: function (data,status){

                callbackfunc(data,context,"success");
            }
        });


}

function doGetStream(url,callbackfunc,context){
lastResponseLength=false;
var ajaxRequest = $.ajax({
        type: 'GET',
        url: url,
        data: {},
        dataType: 'text/plain',
        processData: false,
        xhrFields: {
            // Getting on progress streaming response
            onprogress: function(e)
            {
                var progressResponse;
                var response = e.currentTarget.response;
                if(lastResponseLength === false)
                {
                    progressResponse = response;
                    lastResponseLength = response.length;
                }
                else
                {
                    progressResponse = response.substring(lastResponseLength);
                    lastResponseLength = response.length;
                }
                console.log(progressResponse)
                if (progressResponse.length>0) {
                    callbackfunc(progressResponse, context, "ongoing");
                }
            }
        }
    });

}
